Technical Q&A QA1211
CreateStaticTextControl fails with paramErr


Q: I tried to create a static text item without a window parameter (passing NULL as first parameter) for later embedding in an HIView but CreateStaticTextControl fails with paramErr (-50) when I call it that way. What am I doing wrong?

A: Nothing, this is a known bug (r. 3068049) which will be fixed in a later Mac OS X release. In the meantime, as a workaround, you should call CreateStaticTextControl with the correct window parameter and then move the resulting HIView to the appropriate parent with HIViewAddSubview. If the appropriate parent is the content view of the window, then you don't need to move the resulting HIView since it has already been added there when created.

The CreateStaticTextControl API is not the only one which has this bug. The same problem and workaround also apply to:

CreateRoundButtonControl,
CreatePlacardControl,
CreateIconControl,
CreatePictureControl,
CreatePopupArrowControl, and
CreatePopupButtonControl.


[Nov 12 2002]


Developer Documentation | Technical Notes | Development Kits | Sample Code